<?php

namespace App\Jobs;

use App\Service\MiniWorkService;
use App\User;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;

class SendUserMini implements ShouldQueue
{
    use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
    protected  $message;
    protected  $user;
    /**
     * Create a new job instance.
     *
     * @return void
     */
    public function __construct(User $user,$message)
    {
        $this->message=$message;
        $this->user=$user;
    }

    /**
     * Execute the job.
     *
     * @return void
     */
    public function handle()
    {
       $mini= new MiniWorkService();
       //$mini->send($this->user,$this->message['url'],$this->message['title'],$this->message['content_item']);
        //todo 暂时固定为我
       $mini->send($this->user,$this->message['title'],$this->message['url'],$this->message['content_item']);
    }
}
